execute as @s[team=] run function vs:item/use/use_fail

execute as @s[team=blue] store result score #health temp run data get entity @n[type=marker,tag=StreamBarrierSpawner,tag=blue] data.Health
execute as @s[team=red] store result score #health temp run data get entity @n[type=marker,tag=StreamBarrierSpawner,tag=red] data.Health
execute store result score #StreamBarrierSpawnerMaxHealth temp run data get storage vs:system gamerules[{id:"stream_barrier_spawner_max_health"}].value
execute if score #health temp >= #StreamBarrierSpawnerMaxHealth temp run return run function vs:item/streambarrier_spawner_repair_device/use_fail
scoreboard players reset #health temp
scoreboard players reset #StreamBarrierSpawnerMaxHealth temp

function vs:chain/add {command:"function vs:item/streambarrier_spawner_repair_device/reaction with storage vs:system temp",id:"sbs_repair_device"}